from __future__ import annotations

from dataclasses import dataclass


@dataclass
class HardwareChoice:
    required_WLL_t: float
    recommended_grade: str
    note: str


def select_shackle_or_hook(load_kN: float, dynamic_factor: float = 1.2, safety_factor: float = 6.0) -> HardwareChoice:
    """卸扣/吊钩选型：WLL≥荷载×动载×SF / 9.81。"""

    wll_t = load_kN * dynamic_factor * safety_factor / 9.81
    grade = "G80" if wll_t <= 12.5 else "G100"
    return HardwareChoice(required_WLL_t=wll_t, recommended_grade=grade, note="按等效工作载荷选型")


